#include "radiomodel.h"

RadioModel::RadioModel()
{
    setOffset("");
}
QString RadioModel::getAddtime() const
{
    return addtime;
}

void RadioModel::setAddtime(const QString &value)
{
    addtime = value;
}
QString RadioModel::getBanner() const
{
    return banner;
}
QString RadioModel::getBannerWithSize(int size)
{
    if(banner.isEmpty()){
        return QString();
    }else{
        QString sizeStr = QString("%1").arg(size);
        QString newimgUrl = banner.replace("{size}",sizeStr);
        return newimgUrl;
    }
}

void RadioModel::setBanner(const QString &value)
{
    banner = value;
}
int RadioModel::getClassid() const
{
    return classid;
}

void RadioModel::setClassid(int value)
{
    classid = value;
    reSetRadioKey();
}
QString RadioModel::getClassname() const
{
    return classname;
}

void RadioModel::setClassname(const QString &value)
{
    classname = value;
}
int RadioModel::getDescription() const
{
    return description;
}

void RadioModel::setDescription(int value)
{
    description = value;
}
int RadioModel::getFmid() const
{
    return fmid;
}

void RadioModel::setFmid(int value)
{
    fmid = value;
    reSetRadioKey();
}
QString RadioModel::getFmname() const
{
    return fmname;
}

void RadioModel::setFmname(const QString &value)
{
    fmname = value;
}
int RadioModel::getFmtype() const
{
    return fmtype;
}

void RadioModel::setFmtype(int value)
{
    fmtype = value;
}
int RadioModel::getHeat() const
{
    return heat;
}

void RadioModel::setHeat(int value)
{
    heat = value;
}
QString RadioModel::getImgurl() const
{
    return imgurl;
}
QString RadioModel::getImgurlWithSize(int size)
{
    if(imgurl.isEmpty()){
        return QString();
    }else{
        QString sizeStr = QString("%1").arg(size);
        QString newimgUrl = imgurl.replace("{size}",sizeStr);
        return newimgUrl;
    }
}

void RadioModel::setImgurl(const QString &value)
{
    imgurl = value;
}
int RadioModel::getIsnew() const
{
    return isnew;
}

void RadioModel::setIsnew(const int &value)
{
    isnew = value;
}
QString RadioModel::radioKey() const
{
    return _radioKey;
}

void RadioModel::setRadioKey(const QString &radioKey)
{
    _radioKey = radioKey;
}
void RadioModel::reSetRadioKey()
{
    QString newKey = QString("%1_%2").arg(getClassid()).arg(getFmid());
    setRadioKey(newKey);
}
QString RadioModel::offset() const
{
    return _offset;
}

void RadioModel::setOffset(const QString &offset)
{
    _offset = offset;
}














